package com.albaba.designpattern.flyweight.text_001;

/**
 * @Description: 可共享的具体的享元角色
 * @Author zx
 * @Date 2025/2/21 16:45
 * @Version 1.0
 */
public class ConcreteFlyweight extends Flyweight {

    // 再具体享元类中，需要将内部状态和外部状态分开处理

    // 内部状态
    private String inState;

    public ConcreteFlyweight(String inState) {
        this.inState = inState;
    }


    /**
     * 外部状态
     * @param state
     */
    @Override
    public void operation(String state) {

        System.out.println("内部状态：" + inState + "外部状态：" + state);

    }
}
